package com.cloud.punish.api.web;

import com.cloud.punish.api.bean.ScreenReqInfo;
import com.cloud.punish.api.service.RecPunishInterfaceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @program: quokka-server
 * @description: PunishInterfaceController 对外接口
 * @author: sl
 * @create: 2019-06-26 14:14
 **/
@RestController
@RequestMapping("punish/interface")
public class RecPunishInterfaceController {

	@Autowired
	private RecPunishInterfaceService recPunishInterfaceService;

	/**
	 * 案件指数 时 日 周 月 for screen
	 * 
	 * @param info
	 * @return
	 */
	@RequestMapping("getRecPunishByDate")
	public List<Map<String, Object>> getRecPunishByDate(@RequestBody ScreenReqInfo info) {
		return recPunishInterfaceService.getRecPunishByDate(info);
	}

	/**
	 * 案件问题来源 for screen
	 * 
	 * @param info
	 * @return
	 */
	@RequestMapping("getLegalCaseSource")
	public List<Map<String, Object>> getLegalCaseSource(@RequestBody ScreenReqInfo info) {
		return recPunishInterfaceService.getLegalCaseSource(info);
	}

	/**
	 * 案件区域分布 for screen
	 * 
	 * @param info
	 * @return
	 */
	@RequestMapping("getLegalCaseRegion")
	public List<Map<String, Object>> getLegalCaseRegion(@RequestBody ScreenReqInfo info) {
		return recPunishInterfaceService.getLegalCaseRegion(info);
	}

	/**
	 * 案件top5 for screen
	 * 
	 * @param info
	 * @return
	 */
	@RequestMapping("getLegalCaseDomain")
	public List<Map<String, Object>> getLegalCaseDomain(@RequestBody ScreenReqInfo info) {
		info.setNum(5);
		return recPunishInterfaceService.getLegalCaseDomain(info);
	}

	/**
	 * 大屏首页悬浮栏
	 * 
	 * @param info
	 * @return
	 */
	@RequestMapping("getLegalCaseGeneral")
	public Map<String, Object> getLegalCaseGeneral(@RequestBody ScreenReqInfo info) {
		return recPunishInterfaceService.getLegalCaseGeneral(info);
	}

	/**
	 * 法律法规
	 * 
	 * @return
	 */
	@RequestMapping("getLawCaseTop5")
	public List<Map<String, Object>> getLawCaseTop5(@RequestBody ScreenReqInfo info) {
		return recPunishInterfaceService.getLawCaseTop5(info);
	}

	/**
	 * 法律法规
	 *
	 * @return
	 */
	@RequestMapping("getLawCaseTop")
	public List<Map<String, Object>> getLawCaseTop(@RequestBody ScreenReqInfo info) {
		return recPunishInterfaceService.getLawCaseTop(info);
	}

	@RequestMapping("getLawUseStat")
	public List<Map<String, Object>> getLawUseStat(@RequestBody ScreenReqInfo info) {
		return recPunishInterfaceService.getLawUseStat(info);
	}

	@RequestMapping("getCauseUseStat")
	public List<Map<String, Object>> getCauseUseStat(@RequestBody ScreenReqInfo info) {
		return recPunishInterfaceService.getCauseUseStat(info);
	}

	/**
	 * 根据regionCode查询所有已有违法事实的行政处罚
	 * 
	 * @return
	 */
	@RequestMapping("getBasisCodeByRegionCode")
	public List<Map<String, Object>> getBasisCodeByRegionCode(@RequestBody ScreenReqInfo info) {
		return recPunishInterfaceService.getBasisCodeByRegionCode(info);
	}

	/**
	 * 履职领域top5
	 * 
	 * @return
	 */
	@RequestMapping("getPerformDomain")
	public List<Map<String, Object>> getPerformDomain(@RequestBody ScreenReqInfo info) {
		return recPunishInterfaceService.getPerformDomain(info);
	}

	/**
	 *
	 * @param info
	 * @return
	 */
	@RequestMapping("getLegalCaseInfoByDate")
	public List<Map<String, Object>> getLegalCaseInfoByDate(@RequestBody ScreenReqInfo info) {
		return recPunishInterfaceService.getLegalCaseInfoByDate(info);
	}

	/**
	 * top10
	 * 
	 * @param info
	 * @return
	 */
	@RequestMapping("getLawCaseTopForPerform")
	public List<Map<String, Object>> getLawCaseTopForPerform(@RequestBody ScreenReqInfo info) {
		return recPunishInterfaceService.getLawCaseTopForPerform(info);
	}

	/**
	 * 页面改版 执法信息统计
	 */
	@RequestMapping("getLawDynamicsInfo")
	public Map<String, Object> getLawDynamicsInfo(String unitCode) {
		return recPunishInterfaceService.getLawDynamicsInfo(unitCode);
	}

	/**
	 * 行政处罚部门数量
	 * @param info
	 * @return
	 */
	@RequestMapping("getPunishByRegionId")
	public List<Map<String, Object>> getPunishByRegionId(@RequestBody ScreenReqInfo info) {
		return recPunishInterfaceService.getPunishByRegionId(info);
	}

	/**
	 * 获取任务号
	 * @param recTypeId
	 * @return
	 */
	@RequestMapping("calculate")
	public String calculate(String recTypeId){
		return recPunishInterfaceService.calculate(recTypeId);
	}

}
